<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<f:view>
	<h:head>
		<link type="text/css" rel="stylesheet" href="themes/bluesky/skin.css" />
		<link type="text/css" rel="stylesheet"
			href="resources/css/wienerhelden.css" />
	</h:head>
	<h:body>
		<ui:composition template="template.xhtml">
			<ui:define name="content">

				<p:layout id="mainlayout" style="min-width:400px;min-height:600px;" fullpage="true">
					
					<h:form>
					<p:layoutUnit position="west" resizable="true" size="230"
						minSize="40" maxSize="230" id="first">
						<!--  Side Navigation -->
						<ul id="sideNavigation">
							<li><h:outputLink value="myTasks.xhtml">
									<h:outputText value="My Tasks" />
								</h:outputLink></li>
							<li><h:outputLink value="pool.xhtml">
									<h:outputText value="Open Tasks" />
								</h:outputLink></li>
							
						</ul>
					</p:layoutUnit>
					</h:form>
					
					<p:layoutUnit position="center">
						<h:form id="form1">
						
							<h3>Task assigned to me (That is your Task) </h3>
							
							<p:dataTable id="list3" var="task" value="#{ticketController.tasksFromUser()}">  
						        
						        <p:column headerText="Process Id">  
						            <h:outputText value="#{task.executionId}" />  
						        </p:column>
						        
						        <p:column headerText="Task ID">  
						            <h:outputText value="#{task.id}" />  
						        </p:column>  
						  
						        <p:column headerText="Name">  
						            <h:outputText value="#{task.name}" />  
						        </p:column>  
						  
						        <p:column headerText="Owner">  
						            <h:outputText value="#{task.owner}" />  
						        </p:column>  
						  
						        <p:column headerText="Assignee">  
						            <h:outputText value="#{task.assignee}" />  
						        </p:column> 
						        
						        <p:column headerText="Date Created">  
						            <h:outputText value="#{task.createTime}" />  
						        </p:column>
						        
						        <p:column headerText="Info">  
						            <h:outputText value="#{ticketController.getProcessInfo(task)}" />  
						        </p:column>
						        
						        <p:column id="but1" style="width:4%">  
						            <p:commandButton id="buttonUnassign" value="Unassign" update=":form1" action="#{ticketController.unassignTask(task)}"  icon="ui-icon-person" title="Unassign Task" />  
						        </p:column>
						        
						        <p:column id="but2" style="width:4%">  
						            <p:commandButton id="buttonHandle" value="Handle" update=":form1" action="#{ticketController.handleTask(task)}"  icon="ui-icon-play" title="Handle Task" />  
						        </p:column>
						         
						    </p:dataTable>
						 </h:form>
					</p:layoutUnit>

				</p:layout>
			</ui:define>
		</ui:composition>
	</h:body>
</f:view>
</html>
